<!-- 图片标注顶部的操作按钮 -->
<template>
  <a-button class="icon-only-btn" :class="{ active: active }" type="text" :disabled="disabled" :title="title" @click="emits('click')">
    <i class="iconfont text-18" :class="[iconClass]"></i>
  </a-button>
</template>

<script lang="ts" setup>
  export interface Props {
    title: string
    iconClass: string
    disabled?: boolean
    active?: boolean
  }

  const props = withDefaults(defineProps<Props>(), {
    disabled: false,
    active: false
  })

  const emits = defineEmits<{
    (e: 'click'): void
  }>()
</script>

<style lang="less" scoped>
  .icon-only-btn {
    &.active {
      color: rgba(25, 25, 48, 0.75);
      background: rgba(0, 0, 0, 0.1);
      border: none;
    }
  }
</style>
